London | 26-ITP-May | Dagim Daniel | Sprint 1 | 1-key-exercise -count #1375
London | 26-ITP-May | Dagim Daniel | Sprint 1 | 1-key-exercise -count #1375Dagim-Daniel wants to merge 5 commits into
Conversation
…reated a branch coursework/sprint-1.
…rest is done in this commit . i.e. 2 -initials done, 3-path done , 4 random is done.
| const cardNumber = "4533787178994213"; | ||
| const last4Digits = cardNumber.slice(-4); |
There was a problem hiding this comment.
Suppose you were not allowed to modify the statement const cardNumber = 4533787178994213;
(that is, keep the variable's value unchanged).
How would you modify the code (through type conversion) to still being able to use .slice(-4) to extract the last 4 digits from the given number.
There was a problem hiding this comment.
i will use .toString() for conversion.
There was a problem hiding this comment.
hi Cjyuan do i need to send new PR for me to make this PR complete, i thought we solve it here. if i need to push new PR do tell me please.
There was a problem hiding this comment.
Please refer to my latest comment: #1375 (comment)
|
|
||
| // b) Run the code and identify the line where the error is coming from - why is this error occurring? How can you fix this problem? | ||
| //syntaxError: missing ) after argument list, - | ||
| //the error is occurring because of a missing "," in the replaceAll() method. in line 5. |
There was a problem hiding this comment.
We could more precisely describe where the comma is missing as
"... because a comma is missing between "," and "" in the function call" or
"... because a comma is missing between the ___________s."
What is the programming term that belongs in the blank?
If the questions are placed in the comments, yes. |
|
….js based on the comment given.
|
All good. |
… created a branch coursework/sprint-1.
Learners, PR Template
Self checklist
Changelist
i just created a branch coursework/sprint-1 and also answered 1-key exercise through multiple line comment.
Questions
we can answer some question through comment right?